package de.tum.in.eist.poll.shared;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Representation of a student as a special type of user. It also contains the User's available and already submitted Polls
 * IMPORTANT: available Polls will only be filled after retrieval from the database
 * 
 * @author max
 *
 */


public class Student extends User implements IsSerializable{
	
	List<Poll> availablePolls = new ArrayList<Poll>();
	List<Poll> submittedPolls = new ArrayList<Poll>();
	
	
	public Student(){
		super();
	}
	public Student(String login){
		super(login);
	}
	public Student(String login, byte[] passHash, byte[] salt) {
		super(login, passHash, salt);
	}
	
	
	
	public List<Poll> getAvailablePolls() {
		return availablePolls;
	}
	public List<Poll> getSubmittedPolls() {
		return submittedPolls;
	}
	public void setAvailablePolls(List<Poll> availablePolls) {
		this.availablePolls = availablePolls;
	}
	
	public void setSubmittedPolls(List<Poll> submittedPolls) {
		this.submittedPolls = submittedPolls;
	}
	
	public void addSubmittedPoll(Poll p){
		submittedPolls.add(p);
	}
	
	public void removeAvailablePoll(Poll poll){
		availablePolls.remove(poll);
	}

}
